package com.danielepelagatti.flickrmanager.commands.people
{
	import com.adobe.webapis.flickr.User;
	import com.adobe.webapis.flickr.events.FlickrResultEvent;
	import com.danielepelagatti.flickrmanager.commands.FlickrCommand;
	import com.danielepelagatti.flickrmanager.commands.IFlickrCommand;
	import com.danielepelagatti.flickrmanager.model.Flickr;
	import com.danielepelagatti.flickrmanager.model.LocalUser;
	/**
	 * 
	 * @author redde
	 * 
	 */
	public class GetUploadStatus extends FlickrCommand implements IFlickrCommand
	{
		/**
		 * 
		 * @param event
		 * 
		 */		
		public function error(event:FlickrResultEvent):Boolean
		{
			return false;
		}
		/**
		 * 
		 * @param event
		 * 
		 */		
		public function success(event:FlickrResultEvent):void
		{
			var retUser:User = event.data.user;
			LocalUser.getInstance().user.bandwidthMax 	= retUser.bandwidthMax;
			LocalUser.getInstance().user.bandwidthUsed  	= retUser.bandwidthUsed;
			LocalUser.getInstance().user.filesizeMax		= retUser.filesizeMax;
		}
		/**
		 * 
		 * @return 
		 * 
		 */		
		public function getAPICall():Function
		{
			return flickr.people.getUploadStatus;
		}
		
	}
}